﻿<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="NBooks.Core.Models" assembly="NBooks.Core">
	<class name="PriceLevel" table="price_levels">
		<id name="Id" column="id">
			<generator class="identity" />
		</id>
		<property name="Name" column="name" />
		<property name="Inactive" column="inactive" />
		<bag name="Items" inverse="true" cascade="all-delete-orphan">
			<key column="price_level_id" />
			<one-to-many class="PriceLevelItem" />
		</bag>
	</class>
	<class name="PriceLevelItem" table="price_level_items">
		<id name="Id" column="id">
			<generator class="identity" />
		</id>
		<many-to-one name="Level" class="PriceLevel" column="price_level_id" />
		<many-to-one name="Item" class="Item" column="item_id" />
		<property name="CustomPrice" column="custom_price" />
	</class>
</hibernate-mapping>